package com.example.elm_server_api.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 菜品信息表
 * @TableName food
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Food implements Serializable {
    /**
     * 主键
     */
    private Integer id;

    /**
     * 商店ID
     */
    private Integer shopId;

    /**
     * 分类ID
     */
    private Integer cateId;

    /**
     * 食品名字
     */
    private String title;

    /**
     * 描述
     */
    private String desc;

    /**
     * 食品封面图
     */
    private String cover;

    /**
     * 原价
     */
    private BigDecimal originPrice;

    /**
     * 售价
     */
    private BigDecimal sellPrice;

    /**
     * 折扣
     */
    private BigDecimal discount;

    /**
     * 限购数量
     */
    private Integer limitNum;

    /**
     * 规格选项
     */
    private String option;

    /**
     * 总的销量
     */
    private Integer totalSales;

    /**
     * 月销量
     */
    private Integer monthSales;

    /**
     * 好评率
     */
    private Double praiseRate;

    /**
     * 状态
     */
    private Integer status;

    /**
     * 加入时间
     */
    private Date addTime;


    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Food other = (Food) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
            && (this.getCateId() == null ? other.getCateId() == null : this.getCateId().equals(other.getCateId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getDesc() == null ? other.getDesc() == null : this.getDesc().equals(other.getDesc()))
            && (this.getCover() == null ? other.getCover() == null : this.getCover().equals(other.getCover()))
            && (this.getOriginPrice() == null ? other.getOriginPrice() == null : this.getOriginPrice().equals(other.getOriginPrice()))
            && (this.getSellPrice() == null ? other.getSellPrice() == null : this.getSellPrice().equals(other.getSellPrice()))
            && (this.getDiscount() == null ? other.getDiscount() == null : this.getDiscount().equals(other.getDiscount()))
            && (this.getLimitNum() == null ? other.getLimitNum() == null : this.getLimitNum().equals(other.getLimitNum()))
            && (this.getOption() == null ? other.getOption() == null : this.getOption().equals(other.getOption()))
            && (this.getTotalSales() == null ? other.getTotalSales() == null : this.getTotalSales().equals(other.getTotalSales()))
            && (this.getMonthSales() == null ? other.getMonthSales() == null : this.getMonthSales().equals(other.getMonthSales()))
            && (this.getPraiseRate() == null ? other.getPraiseRate() == null : this.getPraiseRate().equals(other.getPraiseRate()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
        result = prime * result + ((getCateId() == null) ? 0 : getCateId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getDesc() == null) ? 0 : getDesc().hashCode());
        result = prime * result + ((getCover() == null) ? 0 : getCover().hashCode());
        result = prime * result + ((getOriginPrice() == null) ? 0 : getOriginPrice().hashCode());
        result = prime * result + ((getSellPrice() == null) ? 0 : getSellPrice().hashCode());
        result = prime * result + ((getDiscount() == null) ? 0 : getDiscount().hashCode());
        result = prime * result + ((getLimitNum() == null) ? 0 : getLimitNum().hashCode());
        result = prime * result + ((getOption() == null) ? 0 : getOption().hashCode());
        result = prime * result + ((getTotalSales() == null) ? 0 : getTotalSales().hashCode());
        result = prime * result + ((getMonthSales() == null) ? 0 : getMonthSales().hashCode());
        result = prime * result + ((getPraiseRate() == null) ? 0 : getPraiseRate().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", shopId=").append(shopId);
        sb.append(", cateId=").append(cateId);
        sb.append(", title=").append(title);
        sb.append(", desc=").append(desc);
        sb.append(", cover=").append(cover);
        sb.append(", originPrice=").append(originPrice);
        sb.append(", sellPrice=").append(sellPrice);
        sb.append(", discount=").append(discount);
        sb.append(", limitNum=").append(limitNum);
        sb.append(", option=").append(option);
        sb.append(", totalSales=").append(totalSales);
        sb.append(", monthSales=").append(monthSales);
        sb.append(", praiseRate=").append(praiseRate);
        sb.append(", status=").append(status);
        sb.append(", addTime=").append(addTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }


}